package com.example.orderapplication.view

import android.content.Context
import android.util.AttributeSet
import android.widget.GridView

/**
 * @author: Xu QiHao
 * @date: 2021/10/2116:52
 * @Description：
 */
class GridViewForScrollView : GridView {
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(
        context,
        attrs,
        defStyle
    )

    public override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        val expandSpec = MeasureSpec.makeMeasureSpec(Int.MAX_VALUE shr 2, MeasureSpec.AT_MOST)
        super.onMeasure(widthMeasureSpec, expandSpec + 30)
    }
}